package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpNewProductDao;
import com.financing.platform.dto.FpNewProductDTO;
import com.financing.platform.dto.ProjectDTO;
import com.financing.platform.util.SqlName;

@Repository("fpNewProductDaoImpl")
public class FpNewProductDaoImpl extends BaseDaoImpl implements IFpNewProductDao {

	@Override
	public int addFpNewProduct(FpNewProductDTO fnProductDto) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.insertFpNewProduct,fnProductDto);
	}

	@Override
	public List<FpNewProductDTO> queryFpNewProductByWhere(
			FpNewProductDTO fnProductDto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryFpNewProduct,fnProductDto);
	}

	@Override
	public int updateFpNewProduct(FpNewProductDTO fnProductDto)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.updateFpNewProduct,fnProductDto);
	}

	@Override
	public List<Map<String,String>> queryFpNewProductList(
			FpNewProductDTO fnProductDto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryFpNewProductList,fnProductDto);
	}

	@Override
	public int countFpNewProductList(FpNewProductDTO fnProductDto)
			throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.countFpNewProductList,fnProductDto);
	}

	@Override
	public List<Map<String, String>> noBindProjectList(
			FpNewProductDTO fnProductDto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.noBindProjectList,fnProductDto);
	}

	@Override
	public int deleteFpNewProduct(FpNewProductDTO fnProductDto)
			throws SQLException {
		this.sqlMapClient.update(SqlName.deleteFpNewProduct,fnProductDto);
		return 0;
	}

	@Override
	public List<Map<String, Object>> bindProjectList(
			FpNewProductDTO fnProductDto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.bindProjectList,fnProductDto);
	}

	@Override
	public int updatepRecruitmentSummaryById(ProjectDTO projectDto)
			throws SQLException {
		this.sqlMapClient.update(SqlName.updatepRecruitmentSummaryById,projectDto);
		return 0;
	}

	@Override
	public int updateStatus(FpNewProductDTO fnProductDto) throws SQLException {
		this.sqlMapClient.update(SqlName.updateStatus,fnProductDto);
		return 0;
	}

	@Override
	public int bindProjectListCount(FpNewProductDTO fnProductDto)
			throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.bindProjectListCount,fnProductDto);
	}

}
